Skip to content

Improve block state registry patch#13

Open
Meldexun wants to merge 2 commits intoFermiumModding:mainfrom
Meldexun:improve-block-state-registry-patch
Open

Improve block state registry patch#13
Meldexun wants to merge 2 commits intoFermiumModding:mainfrom
Meldexun:improve-block-state-registry-patch

Conversation

@Meldexun
Copy link

This PR makes a few changes to the block state registry identity patch.

Initial size of 65k does not have any significant benefit. At most you are going to save a few milliseconds of startup time. Better use a conservative initial capacity to avoid potential issues.

Store block state IDs in block state instances directly. Improves performance by avoiding two array list accesses and auto-unboxing.

Unnecessary memory usage when not having a lot of mods. Growing a list is fast enough anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant